package com.adley.es.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.adley.es.entity.Post;
import com.adley.es.jpa.repo.PostRepo;

@Service
public class PostService {
    @Autowired
    private PostRepo postRepo;

    public int savePost(Post post) {
        postRepo.save(post);
        return 1;
    }

    public Post findById(Long id) {
        return postRepo.findById(id).get();
    }
}
